package edu.sctu.wujiayi.month05.day20150512;

/**
 * Created by user11 on 2015/5/12.
 */
public class AbstractSix extends AbstractFive implements InterfaceOne{

    public AbstractSix(AbstractEight[] a) {
        super(a);
    }


    private AbstractEight[] c = new AbstractEight[a.length];

    @Override
    public AbstractEight[] getInformation() {
        int m = 0;
        for (int i = 0;i<a.length;i++){
            if (a[i].getGrade()>=60) {
                m++;
//                System.out.println(a[i].getGrade());
//                System.out.println(a[i].getName());
//                System.out.println(a[i].getAge());
//                System.out.println(a[i].getNumber());
//                System.out.println(a[i].getSex());
//                System.out.println(a[i].getAddress());

                c[i] = a[i];

            }
        }
        System.out.println(m);

        return c;
    }

    @Override
    public AbstractEight[] judgeMent(int age) {
        int n = 0;
        for(int i = 0;i<a.length;i++){

            if(a[i].getAge()>age){
                n++;
                System.out.println(a[i].getName());
            }
        }
    System.out.println("年龄大于22的人为："+n);

        return a;
    }
}
